const image = require('./src/image');
const path = require('path');

(async function () {
  generateMacosIcon();
})();

async function generateMacosIcon() {
  const sizes = [16, 32, 64, 128, 256, 512, 1024];
  const sourcePath = path.join(__dirname, 'resource/macos_icon/icon1.png');
  console.log(sourcePath);

  for (let i = 0; i < sizes.length; i++) {
    const targetPath = path.join(
      __dirname,
      `resource/macos_icon/app_icon_${sizes[i]}.png`
    );
    await image.changeImageSize(sourcePath, targetPath, sizes[i], sizes[i]);
  }
}
async function thumbnail() {
  var sourcePath = path.join(__dirname, 'logo.png');
  var targetPath = path.join(__dirname, 'logo1.png');
  await util.thumbnail(sourcePath, targetPath);
  console.log(fs.statSync(sourcePath).size);
  console.log(fs.statSync(targetPath).size);
}
async function generateQr() {
  var logoPath = path.join(__dirname, 'logo1.png');
  var qrPath = path.join(__dirname, 'test_qr.png');
  var scene = 'sdfds';
  await util.generateQR('scene', logoPath, qrPath);
}
